# Contributor: Henrik Riomar <henrik.riomar@gmail.com>
# Maintainer: Henrik Riomar <henrik.riomar@gmail.com>
pkgname=py3-swagger-ui-bundle
_pkgname=swagger_ui_bundle
pkgver=1.1.0
pkgrel=1
pkgdesc="bundled swagger-ui package"
url="https://github.com/dtkav/swagger-ui-bundle"
arch="noarch !riscv64" # missing checkdep
license="Apache-2.0"
checkdepends="
	py3-pytest
	py3-pytest-runner
	"
makedepends="
	py3-flake8
	py3-gpep517
	py3-poetry-core
	py3-setuptools
	py3-wheel
	"
depends="
	python3
	py3-jinja2
	"
subpackages="$pkgname-pyc"
source="https://github.com/dtkav/swagger-ui-bundle/archive/$pkgver/$_pkgname-$pkgver.tar.gz"
builddir="$srcdir/$_pkgname-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
a32f7119698e1303ddab3708b307ab4a83e74804800124bedc78228e0f389ca3442aaff900ac374209813f0f1b01713c65292bda862ec04212593405cbb659fe  swagger_ui_bundle-1.1.0.tar.gz
"
